<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			window.onload = function() {
				var cars = ["奔驰", "宝马", "奥迪"];
				var ul = document.createElement("ul");
				for (var k in cars) {
					var li = document.createElement("li");
					var txt = document.createTextNode(cars[k]);
					li.appendChild(txt);
					ul.appendChild(li);
					li.addEventListener("mouseover",function(){
						this.style.backgroundColor = "rgb(200,200,200)";
					});
					li.addEventListener("mouseout",function(){
						this.style.backgroundColor = "white";
					});
				}
				document.body.appendChild(ul);
			}
		</script>
	</head>
	<body>
	</body>
</html>
